<?php

// PHPMaker 5 configuration for Table view_reg_master_netsales
$view_reg_master_netsales = new cview_reg_master_netsales; // Initialize table object

// Define table class
class cview_reg_master_netsales {

	// Define table level constants
	var $TableVar;
	var $TableName;
	var $SelectLimit = FALSE;
	var $ID;
	var $PreviousID;
	var $MonthYear;
	var $LogDate;
	var $PrevLogDate;
	var $RegisterID;
	var $UserName;
	var $StoreNet;
	var $Short_Over;
	var $Link;
	var $TotalIPPSales;
	var $PrevIPP;
	var $DiffIPP;
	var $LogIPP;
	var $BankIPP;
	var $XReading;
	var $YesterdayXReading;
	var $DiffXreading;
	var $MoneyOrderAmount;
	var $BankMO;
	var $DiffCopay;
	var $CoPayAmount;
	var $CheckAmount;
	var $CreditAmount;
	var $LunchAmount;
	var $PayoutAmount;
	var $z340B;
	var $CoPay;
	var $Kinray;
	var $CashAdj;
	var $OverAmount;
	var $TotalDrawAmount;
	var $PreviousDrawAmount;
	var $CashDiff;
	var $OtherAdj;
	var $RegisterTotal;
	var $PrevCoPayAmount;
	var $fields = array();

	function cview_reg_master_netsales() {
		$this->TableVar = "view_reg_master_netsales";
		$this->TableName = "view_reg_master_netsales";
		$this->SelectLimit = TRUE;
		$this->ID = new cField('view_reg_master_netsales', 'x_ID', 'ID', "`ID`", 3, -1, FALSE);
		$this->fields['ID'] =& $this->ID;
		$this->PreviousID = new cField('view_reg_master_netsales', 'x_PreviousID', 'PreviousID', "`PreviousID`", 3, -1, FALSE);
		$this->fields['PreviousID'] =& $this->PreviousID;
		$this->MonthYear = new cField('view_reg_master_netsales', 'x_MonthYear', 'MonthYear', "`MonthYear`", 200, -1, FALSE);
		$this->fields['MonthYear'] =& $this->MonthYear;
		$this->LogDate = new cField('view_reg_master_netsales', 'x_LogDate', 'LogDate', "`LogDate`", 135, 5, FALSE);
		$this->fields['LogDate'] =& $this->LogDate;
		$this->PrevLogDate = new cField('view_reg_master_netsales', 'x_PrevLogDate', 'PrevLogDate', "`PrevLogDate`", 200, 2, FALSE);
		$this->fields['PrevLogDate'] =& $this->PrevLogDate;
		$this->RegisterID = new cField('view_reg_master_netsales', 'x_RegisterID', 'RegisterID', "`RegisterID`", 200, -1, FALSE);
		$this->fields['RegisterID'] =& $this->RegisterID;
		$this->UserName = new cField('view_reg_master_netsales', 'x_UserName', 'UserName', "`UserName`", 200, -1, FALSE);
		$this->fields['UserName'] =& $this->UserName;
		$this->StoreNet = new cField('view_reg_master_netsales', 'x_StoreNet', 'StoreNet', "`StoreNet`", 5, -1, FALSE);
		$this->fields['StoreNet'] =& $this->StoreNet;
		$this->Short_Over = new cField('view_reg_master_netsales', 'x_Short_Over', 'Short_Over', "`Short_Over`", 5, -1, FALSE);
		$this->fields['Short_Over'] =& $this->Short_Over;
		$this->Link = new cField('view_reg_master_netsales', 'x_Link', 'Link', "`Link`", 200, -1, FALSE);
		$this->fields['Link'] =& $this->Link;
		$this->TotalIPPSales = new cField('view_reg_master_netsales', 'x_TotalIPPSales', 'TotalIPPSales', "`TotalIPPSales`", 5, -1, FALSE);
		$this->fields['TotalIPPSales'] =& $this->TotalIPPSales;
		$this->PrevIPP = new cField('view_reg_master_netsales', 'x_PrevIPP', 'PrevIPP', "`PrevIPP`", 5, -1, FALSE);
		$this->fields['PrevIPP'] =& $this->PrevIPP;
		$this->DiffIPP = new cField('view_reg_master_netsales', 'x_DiffIPP', 'DiffIPP', "`DiffIPP`", 5, -1, FALSE);
		$this->fields['DiffIPP'] =& $this->DiffIPP;
		$this->LogIPP = new cField('view_reg_master_netsales', 'x_LogIPP', 'LogIPP', "`LogIPP`", 5, -1, FALSE);
		$this->fields['LogIPP'] =& $this->LogIPP;
		$this->BankIPP = new cField('view_reg_master_netsales', 'x_BankIPP', 'BankIPP', "`BankIPP`", 5, -1, FALSE);
		$this->fields['BankIPP'] =& $this->BankIPP;
		$this->XReading = new cField('view_reg_master_netsales', 'x_XReading', 'XReading', "`XReading`", 5, -1, FALSE);
		$this->fields['XReading'] =& $this->XReading;
		$this->YesterdayXReading = new cField('view_reg_master_netsales', 'x_YesterdayXReading', 'YesterdayXReading', "`YesterdayXReading`", 131, -1, FALSE);
		$this->fields['YesterdayXReading'] =& $this->YesterdayXReading;
		$this->DiffXreading = new cField('view_reg_master_netsales', 'x_DiffXreading', 'DiffXreading', "`DiffXreading`", 5, -1, FALSE);
		$this->fields['DiffXreading'] =& $this->DiffXreading;
		$this->MoneyOrderAmount = new cField('view_reg_master_netsales', 'x_MoneyOrderAmount', 'MoneyOrderAmount', "`MoneyOrderAmount`", 5, -1, FALSE);
		$this->fields['MoneyOrderAmount'] =& $this->MoneyOrderAmount;
		$this->BankMO = new cField('view_reg_master_netsales', 'x_BankMO', 'BankMO', "`BankMO`", 5, -1, FALSE);
		$this->fields['BankMO'] =& $this->BankMO;
		$this->DiffCopay = new cField('view_reg_master_netsales', 'x_DiffCopay', 'DiffCopay', "`DiffCopay`", 5, -1, FALSE);
		$this->fields['DiffCopay'] =& $this->DiffCopay;
		$this->CoPayAmount = new cField('view_reg_master_netsales', 'x_CoPayAmount', 'CoPayAmount', "`CoPayAmount`", 5, -1, FALSE);
		$this->fields['CoPayAmount'] =& $this->CoPayAmount;
		$this->CheckAmount = new cField('view_reg_master_netsales', 'x_CheckAmount', 'CheckAmount', "`CheckAmount`", 5, -1, FALSE);
		$this->fields['CheckAmount'] =& $this->CheckAmount;
		$this->CreditAmount = new cField('view_reg_master_netsales', 'x_CreditAmount', 'CreditAmount', "`CreditAmount`", 5, -1, FALSE);
		$this->fields['CreditAmount'] =& $this->CreditAmount;
		$this->LunchAmount = new cField('view_reg_master_netsales', 'x_LunchAmount', 'LunchAmount', "`LunchAmount`", 5, -1, FALSE);
		$this->fields['LunchAmount'] =& $this->LunchAmount;
		$this->PayoutAmount = new cField('view_reg_master_netsales', 'x_PayoutAmount', 'PayoutAmount', "`PayoutAmount`", 5, -1, FALSE);
		$this->fields['PayoutAmount'] =& $this->PayoutAmount;
		$this->z340B = new cField('view_reg_master_netsales', 'x_z340B', '340B', "`340B`", 5, -1, FALSE);
		$this->fields['340B'] =& $this->z340B;
		$this->CoPay = new cField('view_reg_master_netsales', 'x_CoPay', 'CoPay', "`CoPay`", 5, -1, FALSE);
		$this->fields['CoPay'] =& $this->CoPay;
		$this->Kinray = new cField('view_reg_master_netsales', 'x_Kinray', 'Kinray', "`Kinray`", 5, -1, FALSE);
		$this->fields['Kinray'] =& $this->Kinray;
		$this->CashAdj = new cField('view_reg_master_netsales', 'x_CashAdj', 'CashAdj', "`CashAdj`", 5, -1, FALSE);
		$this->fields['CashAdj'] =& $this->CashAdj;
		$this->OverAmount = new cField('view_reg_master_netsales', 'x_OverAmount', 'OverAmount', "`OverAmount`", 5, -1, FALSE);
		$this->fields['OverAmount'] =& $this->OverAmount;
		$this->TotalDrawAmount = new cField('view_reg_master_netsales', 'x_TotalDrawAmount', 'TotalDrawAmount', "`TotalDrawAmount`", 5, -1, FALSE);
		$this->fields['TotalDrawAmount'] =& $this->TotalDrawAmount;
		$this->PreviousDrawAmount = new cField('view_reg_master_netsales', 'x_PreviousDrawAmount', 'PreviousDrawAmount', "`PreviousDrawAmount`", 5, -1, FALSE);
		$this->fields['PreviousDrawAmount'] =& $this->PreviousDrawAmount;
		$this->CashDiff = new cField('view_reg_master_netsales', 'x_CashDiff', 'CashDiff', "`CashDiff`", 5, -1, FALSE);
		$this->fields['CashDiff'] =& $this->CashDiff;
		$this->OtherAdj = new cField('view_reg_master_netsales', 'x_OtherAdj', 'OtherAdj', "`OtherAdj`", 5, -1, FALSE);
		$this->fields['OtherAdj'] =& $this->OtherAdj;
		$this->RegisterTotal = new cField('view_reg_master_netsales', 'x_RegisterTotal', 'RegisterTotal', "`RegisterTotal`", 5, -1, FALSE);
		$this->fields['RegisterTotal'] =& $this->RegisterTotal;
		$this->PrevCoPayAmount = new cField('view_reg_master_netsales', 'x_PrevCoPayAmount', 'PrevCoPayAmount', "`PrevCoPayAmount`", 5, -1, FALSE);
		$this->fields['PrevCoPayAmount'] =& $this->PrevCoPayAmount;
	}

	// Records per page
	function getRecordsPerPage() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_REC_PER_PAGE];
	}

	function setRecordsPerPage($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_REC_PER_PAGE] = $v;
	}

	// Start record number
	function getStartRecordNumber() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_START_REC];
	}

	function setStartRecordNumber($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_START_REC] = $v;
	}

	// Advanced search
	function getAdvancedSearch($fld) {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld];
	}

	function setAdvancedSearch($fld, $v) {
		if (@$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld] <> $v) {
			$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld] = $v;
		}
	}

	// Basic search Keyword
	function getBasicSearchKeyword() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH];
	}

	function setBasicSearchKeyword($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH] = $v;
	}

	// Basic Search Type
	function getBasicSearchType() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH_TYPE];
	}

	function setBasicSearchType($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH_TYPE] = $v;
	}

	// Search where clause
	function getSearchWhere() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_SEARCH_WHERE];
	}

	function setSearchWhere($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_SEARCH_WHERE] = $v;
	}

	// Single column sort
	function UpdateSort(&$ofld) {
		if ($this->CurrentOrder == $ofld->FldName) {
			$sSortField = $ofld->FldExpression;
			$sLastSort = $ofld->getSort();
			if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
				$sThisSort = $this->CurrentOrderType;
			} else {
				$sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC";
			}
			$ofld->setSort($sThisSort);
			$this->setSessionOrderBy($sSortField . " " . $sThisSort); // Save to Session
		} else {
			$ofld->setSort("");
		}
	}

	// Session WHERE Clause
	function getSessionWhere() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_WHERE];
	}

	function setSessionWhere($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_WHERE] = $v;
	}

	// Session ORDER BY
	function getSessionOrderBy() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ORDER_BY];
	}

	function setSessionOrderBy($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ORDER_BY] = $v;
	}

	// Session Key
	function getKey($fld) {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_KEY . "_" . $fld];
	}

	function setKey($fld, $v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_KEY . "_" . $fld] = $v;
	}

	// Table level SQL
	function SqlSelect() { // Select
		return "SELECT * FROM `view_reg_master_netsales`";
	}

	function SqlWhere() { // Where
		return "";
	}

	function SqlGroupBy() { // Group By
		return "";
	}

	function SqlHaving() { // Having
		return "";
	}

function SqlOrderBy() { // Order By
	return "LogDate DESC";
}
	// SQL variables
	var $CurrentFilter; // Current filter
	var $CurrentOrder; // Current order
	var $CurrentOrderType; // Current order type

	// Report table sql
	function SQL() {
		$sFilter = $this->CurrentFilter;
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$sFilter, $sSort);
	}

	// Return table sql with list page filter
	function SelectSQL() {
		$sFilter = $this->getSessionWhere();
		if ($this->CurrentFilter <> "") {
			if ($sFilter <> "") $sFilter .= " AND ";
			$sFilter .= $this->CurrentFilter;
		}
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$sFilter, $sSort);
	}

	// Return record count
	function SelectRecordCount() {
		global $conn;
		$cnt = -1;
		$sFilter = $this->CurrentFilter;
		$this->Recordset_Selecting($this->CurrentFilter);
		if ($this->SelectLimit) {
			$sSelect = $this->SelectSQL();
			if (strtoupper(substr($sSelect, 0, 13)) == "SELECT * FROM") {
				$sSelect = "SELECT COUNT(*) FROM" . substr($sSelect, 13);
				if ($rs = $conn->Execute($sSelect)) {
					if (!$rs->EOF) $cnt = $rs->fields[0];
					$rs->Close();
				}
			}
		}
		if ($cnt == -1) {
			if ($rs = $conn->Execute($this->SelectSQL())) {
				$cnt = $rs->RecordCount();
				$rs->Close();
			}
		}
		$this->CurrentFilter = $sFilter;
		return intval($cnt);
	}

	// INSERT statement
	function InsertSQL(&$rs) {
		$names = "";
		$values = "";
		foreach ($rs as $name => $value) {
			$names .= $this->fields[$name]->FldExpression . ",";
			$values .= (is_null($value) ? "NULL" : ew_QuotedValue($value, $this->fields[$name]->FldDataType)) . ",";
		}
		if (substr($names, -1) == ",") $names = substr($names, 0, strlen($names)-1);
		if (substr($values, -1) == ",") $values = substr($values, 0, strlen($values)-1);
		return "INSERT INTO `view_reg_master_netsales` ($names) VALUES ($values)";
	}

	// UPDATE statement
	function UpdateSQL(&$rs) {
		$SQL = "UPDATE `view_reg_master_netsales` SET ";
		foreach ($rs as $name => $value) {
			$SQL .= $this->fields[$name]->FldExpression . "=" .
					(is_null($value) ? "NULL" : ew_QuotedValue($value, $this->fields[$name]->FldDataType)) . ",";
		}
		if (substr($SQL, -1) == ",") $SQL = substr($SQL, 0, strlen($SQL)-1);
		if ($this->CurrentFilter <> "")	$SQL .= " WHERE " . $this->CurrentFilter;
		return $SQL;
	}

	// DELETE statement
	function DeleteSQL(&$rs) {
		$SQL = "DELETE FROM `view_reg_master_netsales` WHERE ";
		$SQL .= EW_DB_QUOTE_START . 'ID' . EW_DB_QUOTE_END . '=' .	ew_QuotedValue($rs['ID'], $this->ID->FldDataType) . ' AND ';
		if (substr($SQL, -5) == " AND ") $SQL = substr($SQL, 0, strlen($SQL)-5);
		if ($this->CurrentFilter <> "")	$SQL .= " AND " . $this->CurrentFilter;
		return $SQL;
	}

	// Key filter for table
	function SqlKeyFilter() {
		return "`ID` = @ID@";
	}

	// Return url
	function getReturnUrl() {
		if (@$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] <> "") {
			return $_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL];
		} else {
			return "view_reg_master_netsaleslist.php";
		}
	}

	function setReturnUrl($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] = $v;
	}

	// View url
	function ViewUrl() {
		return $this->KeyUrl("view_reg_master_netsalesview.php");
	}

	// Edit url
	function EditUrl() {
		return $this->KeyUrl("view_reg_master_netsalesedit.php");
	}

	// Inline edit url
	function InlineEditUrl() {
		return $this->KeyUrl("view_reg_master_netsaleslist.php", "a=edit");
	}

	// Copy url
	function CopyUrl() {
		return $this->KeyUrl("view_reg_master_netsalesadd.php");
	}

	// Inline copy url
	function InlineCopyUrl() {
		return $this->KeyUrl("view_reg_master_netsaleslist.php", "a=copy");
	}

	// Delete url
	function DeleteUrl() {
		return $this->KeyUrl("view_reg_master_netsalesdelete.php");
	}

	// Key url
	function KeyUrl($url, $action = "") {
		$sUrl = $url . "?";
		if ($action <> "") $sUrl .= $action . "&";
		if (!is_null($this->ID->CurrentValue)) {
			$sUrl .= "ID=" . urlencode($this->ID->CurrentValue);
		} else {
			return "javascript:alert('Invalid Record! Key is null');";
		}
		return $sUrl;
	}

	// Function LoadRs
	// - Load Row based on Key Value
	function LoadRs($sFilter) {
		global $conn;

		// Set up filter (Sql Where Clause) and get Return Sql
		$this->CurrentFilter = $sFilter;
		$sSql = $this->SQL();
		return $conn->Execute($sSql);
	}

	// Load row values from rs
	function LoadListRowValues(&$rs) {
		$this->ID->setDbValue($rs->fields('ID'));
		$this->PreviousID->setDbValue($rs->fields('PreviousID'));
		$this->MonthYear->setDbValue($rs->fields('MonthYear'));
		$this->LogDate->setDbValue($rs->fields('LogDate'));
		$this->PrevLogDate->setDbValue($rs->fields('PrevLogDate'));
		$this->RegisterID->setDbValue($rs->fields('RegisterID'));
		$this->UserName->setDbValue($rs->fields('UserName'));
		$this->StoreNet->setDbValue($rs->fields('StoreNet'));
		$this->Short_Over->setDbValue($rs->fields('Short_Over'));
		$this->Link->setDbValue($rs->fields('Link'));
		$this->TotalIPPSales->setDbValue($rs->fields('TotalIPPSales'));
		$this->PrevIPP->setDbValue($rs->fields('PrevIPP'));
		$this->DiffIPP->setDbValue($rs->fields('DiffIPP'));
		$this->LogIPP->setDbValue($rs->fields('LogIPP'));
		$this->BankIPP->setDbValue($rs->fields('BankIPP'));
		$this->XReading->setDbValue($rs->fields('XReading'));
		$this->YesterdayXReading->setDbValue($rs->fields('YesterdayXReading'));
		$this->DiffXreading->setDbValue($rs->fields('DiffXreading'));
		$this->MoneyOrderAmount->setDbValue($rs->fields('MoneyOrderAmount'));
		$this->BankMO->setDbValue($rs->fields('BankMO'));
		$this->DiffCopay->setDbValue($rs->fields('DiffCopay'));
		$this->CoPayAmount->setDbValue($rs->fields('CoPayAmount'));
		$this->CheckAmount->setDbValue($rs->fields('CheckAmount'));
		$this->CreditAmount->setDbValue($rs->fields('CreditAmount'));
		$this->LunchAmount->setDbValue($rs->fields('LunchAmount'));
		$this->PayoutAmount->setDbValue($rs->fields('PayoutAmount'));
		$this->z340B->setDbValue($rs->fields('340B'));
		$this->CoPay->setDbValue($rs->fields('CoPay'));
		$this->Kinray->setDbValue($rs->fields('Kinray'));
		$this->CashAdj->setDbValue($rs->fields('CashAdj'));
		$this->OverAmount->setDbValue($rs->fields('OverAmount'));
		$this->TotalDrawAmount->setDbValue($rs->fields('TotalDrawAmount'));
		$this->PreviousDrawAmount->setDbValue($rs->fields('PreviousDrawAmount'));
		$this->CashDiff->setDbValue($rs->fields('CashDiff'));
		$this->OtherAdj->setDbValue($rs->fields('OtherAdj'));
		$this->RegisterTotal->setDbValue($rs->fields('RegisterTotal'));
		$this->PrevCoPayAmount->setDbValue($rs->fields('PrevCoPayAmount'));
	}

	// Render list row values
	function RenderListRow() {
		global $conn, $Security;

		// ID
		$this->ID->ViewValue = $this->ID->CurrentValue;
		$this->ID->CssStyle = "";
		$this->ID->CssClass = "";
		$this->ID->ViewCustomAttributes = "";

		// LogDate
		$this->LogDate->ViewValue = $this->LogDate->CurrentValue;
		$this->LogDate->ViewValue = ew_FormatDateTime($this->LogDate->ViewValue, 5);
		$this->LogDate->CssStyle = "";
		$this->LogDate->CssClass = "";
		$this->LogDate->ViewCustomAttributes = "";

		// RegisterID
		if (!is_null($this->RegisterID->CurrentValue)) {
			$sSqlWrk = "SELECT `RegisterID` FROM `tb_register` WHERE `RegisterID` = '" . ew_AdjustSql($this->RegisterID->CurrentValue) . "'";
			$sSqlWrk .= " ORDER BY `RegisterID` Asc";
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk) {
				if (!$rswrk->EOF) {
					$this->RegisterID->ViewValue = $rswrk->fields('RegisterID');
				}
				$rswrk->Close();
			} else {
				$this->RegisterID->ViewValue = $this->RegisterID->CurrentValue;
			}
		} else {
			$this->RegisterID->ViewValue = NULL;
		}
		$this->RegisterID->CssStyle = "";
		$this->RegisterID->CssClass = "";
		$this->RegisterID->ViewCustomAttributes = "";

		// UserName
		$this->UserName->ViewValue = $this->UserName->CurrentValue;
		$this->UserName->CssStyle = "";
		$this->UserName->CssClass = "";
		$this->UserName->ViewCustomAttributes = "";

		// StoreNet
		$this->StoreNet->ViewValue = $this->StoreNet->CurrentValue;
		$this->StoreNet->ViewValue = ew_FormatNumber($this->StoreNet->ViewValue, 2, -2, -2, -2);
		$this->StoreNet->CssStyle = "";
		$this->StoreNet->CssClass = "";
		$this->StoreNet->ViewCustomAttributes = "";

		// Short_Over
		$this->Short_Over->ViewValue = $this->Short_Over->CurrentValue;
		$this->Short_Over->ViewValue = ew_FormatNumber($this->Short_Over->ViewValue, 2, -2, -2, -2);
		$this->Short_Over->CssStyle = "";
		$this->Short_Over->CssClass = "";
		$this->Short_Over->ViewCustomAttributes = "";

		// DiffIPP
		$this->DiffIPP->ViewValue = $this->DiffIPP->CurrentValue;
		$this->DiffIPP->ViewValue = ew_FormatNumber($this->DiffIPP->ViewValue, 2, -2, -2, -2);
		$this->DiffIPP->CssStyle = "";
		$this->DiffIPP->CssClass = "";
		$this->DiffIPP->ViewCustomAttributes = "";

		// LogIPP
		$this->LogIPP->ViewValue = $this->LogIPP->CurrentValue;
		$this->LogIPP->ViewValue = ew_FormatNumber($this->LogIPP->ViewValue, 2, -2, -2, -2);
		$this->LogIPP->CssStyle = "";
		$this->LogIPP->CssClass = "";
		$this->LogIPP->ViewCustomAttributes = "";

		// BankIPP
		$this->BankIPP->ViewValue = $this->BankIPP->CurrentValue;
		$this->BankIPP->CssStyle = "";
		$this->BankIPP->CssClass = "";
		$this->BankIPP->ViewCustomAttributes = "";

		// DiffXreading
		$this->DiffXreading->ViewValue = $this->DiffXreading->CurrentValue;
		$this->DiffXreading->ViewValue = ew_FormatNumber($this->DiffXreading->ViewValue, 2, -2, -2, -2);
		$this->DiffXreading->CssStyle = "";
		$this->DiffXreading->CssClass = "";
		$this->DiffXreading->ViewCustomAttributes = "";

		// MoneyOrderAmount
		$this->MoneyOrderAmount->ViewValue = $this->MoneyOrderAmount->CurrentValue;
		$this->MoneyOrderAmount->ViewValue = ew_FormatNumber($this->MoneyOrderAmount->ViewValue, 2, -2, -2, -2);
		$this->MoneyOrderAmount->CssStyle = "";
		$this->MoneyOrderAmount->CssClass = "";
		$this->MoneyOrderAmount->ViewCustomAttributes = "";

		// BankMO
		$this->BankMO->ViewValue = $this->BankMO->CurrentValue;
		$this->BankMO->CssStyle = "";
		$this->BankMO->CssClass = "";
		$this->BankMO->ViewCustomAttributes = "";

		// DiffCopay
		$this->DiffCopay->ViewValue = $this->DiffCopay->CurrentValue;
		$this->DiffCopay->CssStyle = "";
		$this->DiffCopay->CssClass = "";
		$this->DiffCopay->ViewCustomAttributes = "";

		// CheckAmount
		$this->CheckAmount->ViewValue = $this->CheckAmount->CurrentValue;
		$this->CheckAmount->ViewValue = ew_FormatNumber($this->CheckAmount->ViewValue, 2, -2, -2, -2);
		$this->CheckAmount->CssStyle = "";
		$this->CheckAmount->CssClass = "";
		$this->CheckAmount->ViewCustomAttributes = "";

		// CreditAmount
		$this->CreditAmount->ViewValue = $this->CreditAmount->CurrentValue;
		$this->CreditAmount->ViewValue = ew_FormatNumber($this->CreditAmount->ViewValue, 2, -2, -2, -2);
		$this->CreditAmount->CssStyle = "";
		$this->CreditAmount->CssClass = "";
		$this->CreditAmount->ViewCustomAttributes = "";

		// LunchAmount
		$this->LunchAmount->ViewValue = $this->LunchAmount->CurrentValue;
		$this->LunchAmount->ViewValue = ew_FormatNumber($this->LunchAmount->ViewValue, 2, -2, -2, -2);
		$this->LunchAmount->CssStyle = "";
		$this->LunchAmount->CssClass = "";
		$this->LunchAmount->ViewCustomAttributes = "";

		// PayoutAmount
		$this->PayoutAmount->ViewValue = $this->PayoutAmount->CurrentValue;
		$this->PayoutAmount->ViewValue = ew_FormatNumber($this->PayoutAmount->ViewValue, 2, -2, -2, -2);
		$this->PayoutAmount->CssStyle = "";
		$this->PayoutAmount->CssClass = "";
		$this->PayoutAmount->ViewCustomAttributes = "";

		// 340B
		$this->z340B->ViewValue = $this->z340B->CurrentValue;
		$this->z340B->ViewValue = ew_FormatNumber($this->z340B->ViewValue, 2, -2, -2, -2);
		$this->z340B->CssStyle = "";
		$this->z340B->CssClass = "";
		$this->z340B->ViewCustomAttributes = "";

		// CoPay
		$this->CoPay->ViewValue = $this->CoPay->CurrentValue;
		$this->CoPay->ViewValue = ew_FormatNumber($this->CoPay->ViewValue, 2, -2, -2, -2);
		$this->CoPay->CssStyle = "";
		$this->CoPay->CssClass = "";
		$this->CoPay->ViewCustomAttributes = "";

		// Kinray
		$this->Kinray->ViewValue = $this->Kinray->CurrentValue;
		$this->Kinray->ViewValue = ew_FormatNumber($this->Kinray->ViewValue, 2, -2, -2, -2);
		$this->Kinray->CssStyle = "";
		$this->Kinray->CssClass = "";
		$this->Kinray->ViewCustomAttributes = "";

		// CashAdj
		$this->CashAdj->ViewValue = $this->CashAdj->CurrentValue;
		$this->CashAdj->ViewValue = ew_FormatNumber($this->CashAdj->ViewValue, 2, -2, -2, -2);
		$this->CashAdj->CssStyle = "";
		$this->CashAdj->CssClass = "";
		$this->CashAdj->ViewCustomAttributes = "";

		// OverAmount
		$this->OverAmount->ViewValue = $this->OverAmount->CurrentValue;
		$this->OverAmount->ViewValue = ew_FormatNumber($this->OverAmount->ViewValue, 2, -2, -2, -2);
		$this->OverAmount->CssStyle = "";
		$this->OverAmount->CssClass = "";
		$this->OverAmount->ViewCustomAttributes = "";

		// ID
		$this->ID->HrefValue = "";

		// LogDate
		$this->LogDate->HrefValue = "";

		// RegisterID
		$this->RegisterID->HrefValue = "";

		// UserName
		$this->UserName->HrefValue = "";

		// StoreNet
		$this->StoreNet->HrefValue = "";

		// Short_Over
		$this->Short_Over->HrefValue = "";

		// DiffIPP
		$this->DiffIPP->HrefValue = "";

		// LogIPP
		$this->LogIPP->HrefValue = "";

		// BankIPP
		$this->BankIPP->HrefValue = "";

		// DiffXreading
		$this->DiffXreading->HrefValue = "";

		// MoneyOrderAmount
		$this->MoneyOrderAmount->HrefValue = "";

		// BankMO
		$this->BankMO->HrefValue = "";

		// DiffCopay
		$this->DiffCopay->HrefValue = "";

		// CheckAmount
		$this->CheckAmount->HrefValue = "";

		// CreditAmount
		$this->CreditAmount->HrefValue = "";

		// LunchAmount
		$this->LunchAmount->HrefValue = "";

		// PayoutAmount
		$this->PayoutAmount->HrefValue = "";

		// 340B
		$this->z340B->HrefValue = "";

		// CoPay
		$this->CoPay->HrefValue = "";

		// Kinray
		$this->Kinray->HrefValue = "";

		// CashAdj
		$this->CashAdj->HrefValue = "";

		// OverAmount
		$this->OverAmount->HrefValue = "";
	}
	var $CurrentAction; // Current action
	var $EventName; // Event name
	var $EventCancelled; // Event cancelled
	var $CancelMessage; // Cancel message
	var $RowType; // Row Type
	var $CssClass; // Css class
	var $CssStyle; // Css style
	var $RowClientEvents; // Row client events

	// Display Attribute
	function DisplayAttributes() {
		$sAtt = "";
		if (trim($this->CssStyle) <> "") {
			$sAtt .= " style=\"" . trim($this->CssStyle) . "\"";
		}
		if (trim($this->CssClass) <> "") {
			$sAtt .= " class=\"" . trim($this->CssClass) . "\"";
		}
		if ($this->Export == "") {
			if (trim($this->RowClientEvents) <> "") {
				$sAtt .= " " . $this->RowClientEvents;
			}
		}
		return $sAtt;
	}

	// Export
	var $Export;

//	 ----------------
//	  Field objects
//	 ----------------
	function fields($fldname) {
		return $this->fields[$fldname];
	}

	// Table level events
	// Recordset Selecting event
	function Recordset_Selecting(&$filter) {

		// Enter your code here	
	}

	// Recordset Selected event
	function Recordset_Selected(&$rs) {

		//echo "Recordset Selected";
	}

	// Row_Selecting event
	function Row_Selecting(&$filter) {

		// Enter your code here	
	}

	// Row Selected event
	function Row_Selected(&$rs) {

		//echo "Row Selected";
	}

	// Row Rendering event
	function Row_Rendering() {

		// Enter your code here	
	}

	// Row Rendered event
	function Row_Rendered() {

		// To view properties of field class, use:
		//var_dump($this-><FieldName>); 

	}

	// Row Inserting event
	function Row_Inserting(&$rs) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Inserted event
	function Row_Inserted(&$rs) {

		//echo "Row Inserted";
	}

	// Row Updating event
	function Row_Updating(&$rsold, &$rsnew) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Updated event
	function Row_Updated(&$rsold, &$rsnew) {

		//echo "Row Updated";
	}

	// Row Deleting event
	function Row_Deleting($rs) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Deleted event
	function Row_Deleted(&$rs) {

		//echo "Row Deleted";
	}
}
?>
